/*
 * @Author: liujinjun681 liujinjun681@qq.com
 * @Date: 2022-06-27 10:46:56
 * @LastEditors: liujinjun681 liujinjun681@qq.com
 * @LastEditTime: 2022-11-10 15:33:06
 * @FilePath: \hd_ims_web\src\api\board\board.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import axios from '@/utils/request'
import request from '@/utils/request'
class ProcessService {
  /**
   * @description: 新增主表数据
   * @return {*}
   */
  save(data) {
    return axios.post('/putStorage/bill', data)
  }
  upload(data) {
    return axios.put('/putStorage/bill/upload', data)
  }
  /**
   * @description: 新增主表数据
   * @return {*}
   */
  edit(data) {
    return axios.put('/putStorage/bill', data)
  }
  /**
   * @description: 查询主表列表
   * @return {*}
   */
  getList(params) {
    return axios.get(`/putStorage/bill/list`, { params })
  }
  /**
   * @description: 查询主表单据信息
   * @return {*}
   */
  getDetail(processId) {
    return axios.get(`/putStorage/bill/${processId}`)
  }
  /**
   * @description: 查询子表信息
   * @return {*}
   */
  getListChild(processBillCode) {
    return axios.get(`/putStorage/bill/listChild/${processBillCode} `)
  }
  /**
   * @description: 新增子表数据
   * @return {*}
   */
  addChild(data) {
    return axios.post('/putStorage/bill/addChild', data)
  }
  /**
   * @description: 修改子表数据
   * @return {*}
   */
  saveChild(data) {
    return axios.post('/putStorage/bill/editBillWldmMoney', data)
  }
  /**
   * @description: 删除子表数据
   * @return {*}
   */
  deleteChild(data) {
    return axios.post(`/putStorage/bill/removeChild`, data)
  }
  deleteChildDetail(rwmDjbh, rwdId) {
    return axios.delete(`/putStorage/bill/removeChildDetail/${rwmDjbh}/${rwdId}`)
  }

  /**
   * @description: 删除主表数据
   * @return {*}
   */
  delete(ids) {
    return axios.delete(`/putStorage/bill/${ids} `)
  }

  /**
   * @description:提交单据
   * @return {*}
   */
  submit(ids) {
    return axios.put(`/putStorage/bill/submit/${ids} `)
  }

  /**
   * @description: 审核单据
   * @return {*}
   */
  check(ids) {
    return axios.post(`/putStorage/bill/check/${ids} `)
  }
  /**
   * @description: 撤回单据
   * @return {*}
   */
  rollback(ids) {
    return axios.post(`/putStorage/bill/rollback/${ids} `)
  }

  /**
   * @description: 查询要添加的字表数据
   * @return {*}
   */
  getListAdd(params) {
    return axios.get(`/putStorage/bill/listChild`, { params })
  }
  exportTotal(billDjbh) {
    return axios.post(`/putStorage/bill/exportTotal/${billDjbh} `)
  }
  exportDetail(billDjbh) {
    return axios.post(`/putStorage/bill/exportDetail/${billDjbh} `)
  }
  export(params) {
    return axios.get(`/putStorage/bill/export`, { params })
  }
  intoCheck(billId) {
    return axios.put(`/putStorage/bill/intoCheck/${billId} `)
  }
}
export default new ProcessService()
